﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Zhuang.WebSite.Areas.SystemManagement.Models;
using System.Data;
using Zhuang.WebSite.BLL.SystemManagement;

namespace Zhuang.WebSite.Areas.SystemManagement.Controllers
{
    public class MenuController : BaseController
    {
        //
        // GET: /SystemManagement/Menu/

        public ActionResult Index()
        {
            Sys_MenuBLL menu = new Sys_MenuBLL();
            string strJson = menu.GetMenus_System();
            return View();
        }


        public ActionResult GetMenuButtons()
        {
            string roleId= Request.QueryString["roleId"]??"";
            string menuId = Request.QueryString["menuId"] ?? "";

            Sys_MenuBLL menu = new Sys_MenuBLL();
            DataTable dt = menu.GetMenuButtons(roleId,menuId);
            string strJson = "{Rows:" + Zhuang.Utility.Web.JSON.JsonDataHelper.DataTableToJSON(dt) + "}";
            return Content(strJson);
        }
    }
}
